package com.alibaba.algo.dao.user;

import com.alibaba.algo.cooperation.usercomponent.vo.req.user.SelectResourceActionListByRoleReqVO;
import com.alibaba.algo.cooperation.usercomponent.vo.res.user.SelectResourceActionListVO;
import com.alibaba.algo.cooperation.usercomponent.vo.req.user.UpdateRoleResourceActionVO;
import com.alibaba.algo.cooperation.usercomponent.vo.res.user.ResourceInfo;
import com.alibaba.algo.core.base.BaseMapper;
import com.alibaba.algo.entity.user.SysRoleResourceAction;

import java.util.List;

/**
 * 类SysResourceMapper.java的实现描述：资源Mapper
 *
 * @author nieganggang 2021-03-12 16:08:17
 */
public interface SysRoleResourceActionMapper extends BaseMapper<SysRoleResourceAction> {

    /**
     * 根据角色编码查询其拥有的资源动作组列表
     * 测试先返回1条记录
     */
    Long selectResourceActionIdByResourceIdActionCode(UpdateRoleResourceActionVO vo);

    Long selectRoleIdByCode(UpdateRoleResourceActionVO vo);

    List<ResourceInfo> selectResourceListAll(String appCode);

    List<SelectResourceActionListVO> selectResourceActionListAll(String appCode);

    List<SelectResourceActionListVO> selectResourceActionListByRoleReq(SelectResourceActionListByRoleReqVO vo);

    //int insert(UpdateRoleResourceActionVO vo);

    int deleteListByRole(UpdateRoleResourceActionVO vo);

    int delete(UpdateRoleResourceActionVO vo);

    int deleteByActionIdAndAppCode(SysRoleResourceAction vo);

}
